AE -- Another Editor Version 1.4 Manual Why Another Editor? ------------------- There are already so many editors for MS-DOS, why take the trouble to invent the wheel once more? Well, I couldn't find an editor that suited my needs. I wanted one that: - could do simple ASCII editing, for writing programs and small texts. - had user-definable keyboard macros, in case I had some repetitive editing to do. - was small, so that it could be run from floppy. - was efficient: the most important options, like cursor movement and cutting/pasting must be done with a single keystroke. The result is AE. If you are an unexperienced PC user, then read on. I hope that this manual will explain enough to let you use AE effectively. If you are already familiar with other editors like the Norton editor or Borland's Turbo editors, you should have little trouble getting started with AE. You can get a list of AE's commands by pressing the F1 key. However, some of the details may not be immediately clear. Below, you will find a point-by point discussion of these. 1. Entrance and exit -------------------- The editor is started by typing "AE" on the DOS command line. (If you hadn't guessed!) Alternatively, you can start editing an existing file by giving the filename as an argument (see also the section "Loading and saving files" below). At any point during editing, when you are giving a command but have changed your mind, you can press the Escape key to exit. The command will not be executed, and AE will return to its normal state. Escape will not terminate the program. To do this, you must use the exit command Alt-X. 2. Loading and saving files --------------------------- You can load a file into AE either by typing it as an argument on the command line when starting (e.g. 'AE MYFILE.TXT'), or by pressing F3 once AE is running. AE can handle filenames with wildcards. If the filename you enter contains a '?' (for any single character) or a '*' (for any series of characters), then you will get on your screen a list with the names of all files that match the wildcard pattern. So, if you want to choose from all files in the current directory, try to load '*.*'. In the list, you can move a selection bar with the 'up' and 'down' keys, or PgUp and PgDn. You can also select a file from the file list by pressing the first letter of its name. So if for instance you press the "A" key repeatedly, the selection bar will step through all the file names beginning with an A. When you have selected the file you want, press Return to load it. On the bottom of the file list you will find the directories that the current directory is connected to. Directory names are indicated by a preceding "¯". If you press Enter with the selection bar on a directory, AE will scan that directory and show you a new file list. In this way you can search the whole disk for the file you want. It is also possible to read the contents of another file and add them to the current one. This is the 'INSERT FILE' option. You can use it by pressing Shift-F3. Saving a file can be done by pressing F2. If the file does not have a name yet, AE will ask you to give it one. The name of the file you are editing can be seen on the statusline. If you want to store your file with a different name, then you should use Shift-F2. You will then be asked to enter the new filename. AE will notice if you have changed a file. You can also see this by the asterisk beside the filename on the statusline. If you have made changes and try to load another file without saving the old one first, AE will notify you and ask if the old file should be saved first. The same goes if you try to quit the program without having saved your file. 3. Cursor movement ------------------ The keys to move the cursor are the same as just about every other editor for MS-DOS: up, down, left, right: move one position in that direction Ctrl-left, Ctrl-right: go to start of previous/next word Home, End: go to begin/end of the current line Ctrl-Home, Ctrl-End: go to first/last line on the screen PgUp,PgDn: move one screenful up/down Ctrl-PgUp, Ctrl-PgDn: go to begin/end of file 4. Typing characters and deleting them -------------------------------------- This is, again, very much like other editors. When you type in a character, it will either be inserted into the text, or it will replace the character under the cursor. This depends on the mode, which is either 'Insert' or 'Overwrite'. You can switch between these modes by pressing the Ins key. The current mode is shown on the statusline . For some commands you will be asked to enter some text (like a filename for loading a file). The text will appear on the bottom line of the screen, temporarily erasing the statusline. Keys that work here usually have the same effect as in normal typing: left, right, Home, End, Delete and Backspace. Overwrite mode does not exist in these cases; characters are always inserted. Another peculiarity is that if the first key you press is a character key, the text that was present will be erased. If you start with any other key, you will modify the existing text. When you have finished your input, you can press Enter to proceed. To remove a character you can either use the Backspace or the Delete key. The latter will remove the character under the cursor, the former removes the one directly left to it. There also are commands to remove more than one character at a time: Delete line (Alt-L) deletes the current line, delete word forward (Alt-W) deletes text from the cursor to the beginning of the next word. (Words can be separated by spaces or any of the characters : ; , or.) 5. Cutting and pasting ---------------------- The keys mentioned so far may be fine to add and remove a couple of characters, but to handle larger pieces of text you need to cut and paste. The first step for this is to move the cursor to one end of the piece of text, and then place a mark with the F5 key. The mark itself is not shown, but when you move the cursor away from the mark, you will see a highlighted piece between the mark and the cursor. This is called the block. Now you can delete the block (with Shift-F6), copy it to the paste buffer (with F7), or cut it (with F6). The difference between cut and copy is that cutting the block removes it from your text, while copy makes no changes in the text. Unless you have chosen to delete, the contents of the block are now stored in the paste buffer. You can insert the contents of the paste buffer into a different part of the text, or into the text in a different window. Move the cursor to the position where you want to insert it, then press F8. Pasting does not change the paste buffer, so pressing F8 more than once will insert multiple copies of the block. If you don't want to do anything with the block you can remove the mark with Shift-F5. The last option I want to mention is comparing the block to the paste buffer. This can be handy if you want to check whether two pieces of text are completely equal or not. After cutting or copying the first piece, select the second piece, then press Shift-F7. The result will be shown on the statusline. 6. Searching and replacing text ------------------------------- You can search for a sequence of characters in the text and, optionally, replace it by another. These commands are started with F4 and Shift-F4 respectively. You will first be asked to enter the text to look for, the text to replace it with (if you have pressed Shift-F4), and the search options. Possible search options are R, I and N. The R option means reverse search. Normally the search will be from the cursor position forward. The I option tells AE to ignore the case of the characters, so that an uppercase "A" will be equal to a lowercase "a", etc. The N option is only valid for replacing, and stands for "no query". If you leave out the N option, AE will move the cursor to the next occurrence of the search text, show it and ask you if it should be replaced. You can then press Y or N, or Escape to stop. Unqueried replace will automatically scan the whole text from the cursor onwards, and replace every occurrence of the search text. Pressing Alt-R will repeat the last search/replace operation. There is another way to enter the sequence that must be searched for: select a block so that it contains the text you want to find, then press F4 or Shift-F4. You will see that the search text has already been filled in. In this way you can look for other occurrences of, say, a word. One more thing: if you want to search for a "new line" character, press Ctrl-Enter. (Just the Enter key won't do, because this is used to end your input.) 7. Multiple files ----------------- In AE you can edit several files at the same time. You can view them in 'windows'. There are three windows, indicated by the letter A, B or C on the left of the statusline. Mind you, you can only view one window at a time; it takes up the whole screen. Switching between windows is done with F9 or Shift-F9 (the latter switches in reverse direction). 8. Keyboard macros ------------------ You can define 10 keyboard macros. To define a macro, press Alt-D. You will be asked for the number of the macro you want to define. After that, AE will record every key you press. Definition is ended by pressing Alt-D once more. (The definition mode is indicated by 'Def' on the statusline.) Now you can replay macro number 1 with Alt-1, number 2 with Alt-2, and so on to number 10 with Alt-0. AE will act just as if you had typed the whole series of keystrokes again. You can replay a macro while defining another one, so you can make it a powerful tool for repetitive tasks. As a small example, the following sequence of keys will define a macro that deletes all text from the cursor to the end of the current line: <1> Note: The occurrence of errors (like searching for a string that doesn't exist) will terminate macro execution. Macro execution does not work when you are entering DOS commands. 9. Setup -------- You can set several preferences for working with AE. These preferences can be set by pressing Shift-F1. On the statusline you will then see a menu containing the options you can set. They are listed below: Display : Controls for the appearance of text on the screen. Colors : Sets the color of normal text, block and statusline. Selecting this option will cycle through several predefined colour combinations. (Note: on monochrome monitors there are only two combinations. ) cursorType : Sets the shape of the cursor. Dots-for-spaces : If this switch is on, spaces in the text will be displayed as small dots. Environment : Miscellaneous options. Keyclick : If on, produces an audible click when a key is pressed. Bell : Normally, when AE reports an error, you will hear a beep. This can be switched off. Wordwrap : See the section "Formatting text". Tabs : See the section "Tabs". Autoindent : See the section "Formatting text". Insert : Toggles between insert and overwrite mode (see also the section "Typing characters and deleting them") File : Several options to control the saving of files. Exit-auto-save : If this switch is on, AE will automatically save a changed file on exiting the program. Interval-auto-save : AE can periodically save your file. With this option you can set the interval. (When 0, the option is off.) Backup-files : When on, AE will rename the old copy of your file before saving the new version. The backup will have thew extension "BAK". Printer : Options to control the printing of your text. See the section "Printing text". Save-setup : Save the setup to a file (explained below). To select an option in the setup, press the capital letter in its name. So, to change the display colors, press Shift-F1 followed by "D" and "C", to set the tab spacing Shift-F1 plus "E" and "T", and so on. When you set a switch option (one that can be on or off), you will see a question on the screen followed by "Yes" or "No". You can change the setting in two ways: by pressing the "Y" or "N" key directly, or by pressing the spacebar until it is set as you want it and then pressing Return. Every option that can be set with Shift-F1 is included in the setup. You can save this setup. AE will store it as 'AE.CFG' in the current directory. When AE is started, it searches for AE.CFG in the current directory. If it doesn't find the setup file there, it looks for the setup file in the directory where the program itself is. If this directory doesn't contain one either, it will use a default setup. This gives you the possibility to store several setup files in different directories. For example, you can store a setup for typing in programs in C:\PROGS, and store a different setup for writing letters in C:\TEXT. If you have stored AE.EXE in C:\UTIL then you can put a general purpose setup in that directory. The keyboard macros are also included in the setup file. 10. Printing text ----------------- AE offers the possibility to print the text you are editing. You can either print the whole text (with Alt-P) or just the selected block (with Shift-F8). A couple of options are provided to get your text on the right spot on the paper. They are accessible by Shift-F1 P. If you set the page length to, say, 60, then AE will send a form feed to the printer after every 60 lines of text. Page numbers can be added. The top margin is the number of blank lines that is inserted at the beginning of every new page. The left margin is the number of spaces on the left of each printed line. Page breaks can be inserted by typing Ctrl-L (a.k.a. form feed character). This will appear in the text, but when printed it will cause the printer to advance the paper to the top of the next page. One last option is the "eject printer page" command. If you press Alt-E, AE will send a form feed to the printer, so that it will feed the paper to the next page. 11. MS-DOS commands ------------------- You can interrupt editing to give a couple of DOS commands by pressing F10. AE will then start a DOS shell. To return to AE afterwards, type the command "exit" on the DOS command line. During these commands, AE will remain in memory, so there will be only about 200 to 300 kilobytes left, which is not enough to run large programs. Note: To start a DOS shell, AE reads the environment variable COMSPEC. This variable indicates the directory and name of the command interpreter that must be started to process your commands. If COMSPEC is not set, you will get an error message (COMMAND.COM not found). As a remedy, type the DOS command "SET COMSPEC=C:\COMMAND.COM" (or something similar, depending on where you have stored COMMAND.COM), before you start AE. 12. Formatting text ------------------- With AE you can create a text with left and right margins like the one you are now reading, by using autoindent and word wrap. If autoindent is on and you press Enter, AE will insert not only a new line, but also the same number of spaces that the previous line starts with. You can switch autoindent on and off in the setup (Shift-F1 E A). If word wrap is on, AE will truncate the lines you type when they have reached a certain length, and proceed on a new line. In this way, your text will be formatted as you type. However, if you insert text in the middle of a line, its length may exceed the wrap length. To reformat, press Alt-F. Note that this command reformats the whole paragraph, i.e. it goes on until it encounters the next blank line. You can set the line length for word wrap in the setup (Shift-F1 E W). A line length of 0 means word wrap is off. On the statusline you can see if autoindent and word wrap are switched on. There are two more commands to format text: Alt-C will center the current line (e.g. for titles) and Alt-J will justify it to the right margin. These, too, only work if word wrap is on. 13. Saving positions -------------------- AE can store the current cursor position, to restore it later. This can be handy especially if you are programming a keyboard macro, or jumping to and fro in a text. The positions are saved last-in-first-out, meaning that the position that is restored is the one that was last saved. Saving a position is done with Alt-S, restoring a saved position with Alt-G. 14. Tabs -------- Pressing the Tab key will move the cursor to the next tab stop, and Shift-Tab will move to the previous one. AE knows two ways to position tab stops: fixed-distance and aligned. If the tabs are aligned, AE will look on the line above for the next (or previous) beginning of a word. In that way you can get your text lined up neatly. With fixed-distance tab stops, the cursor will move to a certain column number. If you have set the tab spacing to, e.g. 8, then the tab stops will be on column 1, 9, 17, 25 and so on. You can set the tab spacing in the setup. A tab spacing of 0 means aligned tabs. 15. Special characters ---------------------- Special characters are those that are not present as normal keys on the keyboard. There are control characters, characters for foreign languages and graphical characters to make frames and the like. AE offers a couple of ways to insert them into your text. The ASCII table command (Alt-I) displays a table with the full IBM character set. You can choose from this table by moving the cursor to the desired character and pressing Enter. If you know the ASCII value of the character you want, you can also enter it by typing its number on the numerical keypad while holding down the Alt key. Control characters are the characters with ASCII value between 0 and 31. You can enter control characters directly from the keyboard as Ctrl-A, Ctrl-B, etc. All control characters will be visible in your text, except for Ctrl-M, which is the line separator. Warning: Be careful with the Ctrl-Z character (ASCII value 26). In MS-DOS, it serves as the end-of-file character. If you save a file containing this character, you will lose all text following it. 16. Miscellaneous ----------------- Below you will find a list with the commands that have not been mentioned so far. * Match brackets (Alt-M). If the cursor is placed at a bracket and Alt-M is pressed, AE will search for the corresponding bracket. The search is forward when started at a left (opening) bracket, and backward when at a right bracket. * New (Alt-N). Clears the file buffer, i.e. it deletes the text that is loaded, so you can start working on a new file. If the old text has been changed, you will be asked if you want to save it first. * Toggle case (Alt-T). Reverses the case of the characters in the currently selected block. * Show version number (Alt-Z). Shows on the statusline the version number and date of the copy of AE that you are using. 17. The SPLIT and MERGE utilities --------------------------------- AE can only handle files that are smaller than 64 kilobytes (65536 bytes). In most cases this will be enough. However, if you have a large file to edit, there is a way to get around this restriction. You can first split your file in several parts, edit the parts, and then glue them together again. The SPLIT and MERGE utilities are provided for this. They can be called from the DOS command line as follows: SPLIT [] Splits the file into smaller chunks. You can give the size of the chunks in bytes or in kilobytes (respectively as a number, or a number followed by "k"). If you don't enter a chunksize, a default of 60 kilobytes will be taken. MERGE [ ... ] Will read the files , and so on to and put their contents in a big file . The names of the parts can contain wildcards ("?" or "*"). The files whose names satisfy the wildcard pattern are read in the same order as they appear in a directory listing. As an example, suppose you have a large file MYFILE.TXT of 150 kilobytes. The command SPLIT MYFILE.TXT 50k will generate three smaller files MYFILE.000, MYFILE.001 and MYFILE.002 of 50 kilobytes each, which you can edit with AE. When you have finished editing, you enter the command MERGE MYFILE.000 MYFILE.001 NEWFILE.TXT or MERGE MYFILE.00? NEWFILE.TXT and you will get a new file NEWFILE.TXT containing the edited contents of the parts.